package com.itbaiyun.usercenter.common;

/**
 * 返回工具类
 */
public class ResultUtil {
    //成功的
    public static <T> BaseResponse<T> sucess(T data){
        return new BaseResponse<>(200,data,"ok");
    }


    /*-------------------------------------------------------------------*/

    //失败的
    public static BaseResponse error(ErrorCode code){
        return new BaseResponse(code);
    }

    public static BaseResponse error(int code,String message,String description){
        return new BaseResponse(code,message,description);
    }


    public static BaseResponse error(ErrorCode code,String message,String description){
        return new BaseResponse(code.getCode(),message,description);
    }


}
